ofDynamicKey

fun <T> ofDynamicKey(defaultValue: Identifier, key: RegistryKey<out Registry<T>>, predicateId: String, predicate: Predicate<RegistryEntry<T>>): ValidatedIdentifier
fun <T> ofDynamicKey(defaultValue: Identifier, key: RegistryKey<out Registry<T>>, predicateId: String, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Used primarily for dynamic registries that aren't synced to clients (Loot registries, primarily)

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.5.6

Parameters

defaultValue

the default value of the ValidatedIdentifier

key

RegistryKey for the registry whose ids are valid for this identifier

predicateId

String unique id for the predicate provided; used to properly sync ids that this predicate cares about

predicate

Predicate tests an allowable subset of the registry


fun <T> ofDynamicKey(key: RegistryKey<out Registry<T>>, predicateId: String, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedIdentifier

Builds a ValidatedIdentifier based on an allowable registry of values, defined from a RegistryKey

Used primarily for dynamic registries that aren't synced to clients (Loot registries, primarily)

Uses "minecraft:air" as the default value

Return

ValidatedIdentifier wrapping the provided registry

Author

fzzyhmstrs

Since

0.5.6

Parameters

key

RegistryKey for the registry whose ids are valid for this identifier

predicateId

String unique id for the predicate provided; used to properly sync ids that this predicate cares about

predicate

BiPredicate tests an allowable subset of the registry